package com.wayne.mapper;

import com.wayne.annotations.Delete;
import com.wayne.annotations.Insert;
import com.wayne.annotations.Select;
import com.wayne.annotations.Update;
import com.wayne.pojo.User;

import java.util.List;

public interface IUserDao {
  @Select(value = "select * from t_user",affectData = true)
  List<User> findAll();

  @Select("select * from t_user where id = #{id} ")
  User findOne(Integer id);

  @Insert("insert into t_user values(#{id},#{username})")
  int addUser(User user);

  @Update("update t_user set username = #{username} where id = #{id}")
  int updateUser(User user);

  @Delete("delete from t_user where id = #{id}")
  int deleteUser(Integer id);
}
